package nodes.command;

import java.util.List;
import parser.ParserException;
import model.Model;
import nodes.AbstractNode;
import nodes.ConstantNode;


/**
 * Returns the first active turtle's heading in degrees
 */
public class HeadingC extends AbstractCommand
{
    public AbstractNode evaluate (List<AbstractNode> myArguments, Model model)
    {
        if (myArguments.size() != Integer.parseInt(resources.getString("heading")))
        {
            throw ParserException.BAD_ARGUMENTS;
        }

        return new ConstantNode(model.getActiveTurtles().get(0).getHeading());

    }
}
